<template>
  <el-form label-position="left" label-width="95px">
    <Portlet title="异常费用">
      <span slot="tools" style="color: #FF0000">费用金额正数为收，负数为支</span>
      <el-row :gutter="15" v-for="(item, index) in abnormalCosts" :key="index">
        <el-col :md="12" :lg="8" :xl="6">
          <el-form-item label="费用名称：">
            <span>{{item.costNo | filterDataBaseDictionary}}</span>
          </el-form-item>
        </el-col>
        <el-col :md="12" :lg="8" :xl="6">
          <el-form-item label="费用金额：">
            <span>{{item.costMoney}} 元</span>
          </el-form-item>
        </el-col>
        <el-col :md="12" :lg="8" :xl="6">
          <el-form-item label="费用备注：">
            <span>{{item.costRemark}}</span>
          </el-form-item>
        </el-col>
      </el-row>
    </Portlet>
    <Portlet>
      <el-row :gutter="15" v-for="(item, index) in abnormalCosts" :key="index">
        <el-col :md="12" :lg="8" :xl="6" v-if="abnromalSouce == '1'">
          <el-form-item label="货物处理：">
            <span>{{(chAbnormal.orderIsStorage === 1) ? '异常完结后货物入库' : '异常完结后货物不入库'}}</span>
          </el-form-item>
        </el-col>
        <el-col :md="12" :lg="8" :xl="6">
          <el-form-item label="处理人：">
            <span>{{chAbnormal.dealUserName}}</span>
          </el-form-item>
        </el-col>
        <el-col :md="12" :lg="8" :xl="6">
          <el-form-item label="处理时间：">
            <span>{{chAbnormal.dealDate | unixTimestampFilter}}</span>
          </el-form-item>
        </el-col>
      </el-row>
    </Portlet>
  </el-form>
</template>

<script>
import {dotData} from '@/utils'
import {filterDataBaseDictionary, unixTimestampFilter} from '@/filters'
export default {
  name: 'AbnormalModule',
  components: {
  },
  props: {
    detail: {
      type: Object,
      required: true
    }
  },
  filters: {
    filterDataBaseDictionary,
    unixTimestampFilter
  },
  data() {
    return {}
  },
  computed: {
    abnormalCosts() {
      return dotData(this.detail, 'abnormalCosts') || []
    },
    chAbnormal() {
      return dotData(this.detail, 'chAbnormal') || {}
    },
    abnromalSouce() {
      return dotData(this.detail, 'chAbnormal.abnromalSouce')
    }
  }
}
</script>
